pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let (base_num_str, n) = match num_str.split_once('(') {
        Some((base, rest)) => (base, rest),
        None => ("", ""),
    };
    let base_n = n.trim_matches(')').parse::<u32>().unwrap();

      
    let mut result = String::new();
    
    let num_ten_result = u64::from_str_radix(base_num_str, base_n); //转化为10进制
    let mut num_ten = 0;
    match num_ten_result {
        Ok(decimal_num) => {num_ten = decimal_num;}
        Err(e)=> {println!("{}",e);}
    }
    while num_ten > 0 {
        let remainder = (num_ten % to_base as u64) as u32;
        result.push_str(&remainder.to_string());  
        num_ten /= to_base as u64;                        
    }

    result.chars().rev().collect()
}
